]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
sessionMode: Add stylesheetName property
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 5 Feb 2013 03:13:44 +0000 (04:13 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 5 Feb 2013 18:54:17 +0000 (19:54 +0100)
This will allow to visually differentiate modes by providing
separate styling.

https://bugzilla.gnome.org/show_bug.cgi?id=693219

js/ui/main.js
js/ui/sessionMode.js

index 7d7d0632386d16a606534991609aeffd1eec8ad1..5a6ab0b690839eab2de3aeb4a019218d9a09f0eb 100644 (file)
@@ -95,6 +95,8 @@ function start() {
     Gio.DesktopAppInfo.set_desktop_env('GNOME');
 
     sessionMode = new SessionMode.SessionMode();
+    sessionMode.connect('updated', _loadDefaultStylesheet);
+
     shellDBusService = new ShellDBus.GnomeShell();
     shellMountOpDBusService = new ShellMountOperation.GnomeShellMountOpHandler();
 
@@ -117,8 +119,7 @@ function start() {
     global.stage.color = DEFAULT_BACKGROUND_COLOR;
     global.stage.no_clear_hint = true;
 
-    _defaultCssStylesheet = global.datadir + '/theme/gnome-shell.css';
-    loadTheme();
+    _loadDefaultStylesheet();
 
     // Set up stage hierarchy to group all UI actors under one container.
     uiGroup = new Shell.GenericContainer({ name: 'uiGroup' });
@@ -379,6 +380,18 @@ function _nWorkspacesChanged() {
     return false;
 }
 
+function _loadDefaultStylesheet() {
+    if (!Main.sessionMode.isPrimary)
+        return;
+
+    let stylesheet = global.datadir + '/theme/' + sessionMode.stylesheetName;
+    if (_defaultCssStylesheet == stylesheet)
+        return;
+
+    _defaultCssStylesheet = stylesheet;
+    loadTheme();
+}
+
 /**
  * getThemeStylesheet:
  *
index 2774ad6d5b2b9f5c23d2f65ef6b2693175d1ced6..f802dbd29f362bd708d512e2507120d11bf28dae 100644 (file)
@@ -15,6 +15,7 @@ const DEFAULT_MODE = 'restrictive';
 const _modes = {
     'restrictive': {
         parentMode: null,
+        stylesheetName: 'gnome-shell.css',
         hasOverview: false,
         showCalendarEvents: false,
         allowSettings: false,